// SETUP

#include intrographics.txt
#include ladyluckbiggraphics.txt

setdatapath("data/graphics/cutscenes/robot/");

var robotgraphics = {
	idle: {
		animation: "robot_idle.json",
		pack: "robot.pck",
		loop: true
	},
	worried_idle: {
		animation: "robot_worried_idle.json",
		pack: "robot.pck",
		loop: true
	}
}
var robot = addsprite("robot", 1, robotgraphics);

// HELPER FUNCTIONS	

var fade_time = 0.4;

// ACTORS
actor("Lady Luck", screenwidthmid + 800, 550, Col.YELLOW, CENTER, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
actor("Robot", 2600, 780, 0xDDDDDD, CENTER, BOTTOM, "chat_robot", "characters/robot/charicon_robot");

// INTRO

play("music_cutscene_lesscheery");

robot.scale = 0.5;
robot.x = 2700 - ((robot.getwidth("idle") * robot.scale) / 2);
robot.y = 800;
changebackground("intro_stage");
fadein();
robot.show("idle");

ladyluck_big.x = -screenwidth;
ladyluck_big.show("idle");
Actuate.tween(ladyluck_big, 2, { x: 0 }).ease(Expo.easeOut);
play("cutscene_audience");

wait(0.5);

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "BZZZZT! BEEP! It’s our little optimised optimist the Robot!");
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "How are the calculations coming along, my dear?");
ladyluck_big.show("idle", true);

actor("Robot", 2600, 780, 0xDDDDDD, CENTER, BOTTOM, "chat_robot", "characters/robot/charicon_robot");
speak("Robot", "They’re good!");
speak("Robot", "Er, I don’t really beep, you know.");

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "I do know, yes. Still keen to be the|very best version of yourself?");
ladyluck_big.show("idle", true);

speak("Robot", "Well! Yes!");
speak("Robot", "But I was wondering...");
speak("Robot", "Since I’ve completed some of my episodes...");
speak("Robot", "Could I maybe leave now and just win, say,|two hours less sleep a night?");

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
ladyluck_big.show("talking-thinking", true);
speak("Lady Luck", "Oh, what an interesting idea!|Let me have a think...");
ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "No. No, you obviously can’t.");
speak("Lady Luck", "Haven’t you been paying any attention at all?");
speak("Lady Luck", "Get back in the Dungeons, pal-culator.");
ladyluck_big.show("idle-sly", true);

startgamefromcutscene();